<template>
  <div class="hello">
    <div style="background-color: #EBEBEB;min-height:900px">
    <div style="width:100%;background-color: #636363; overflow: hidden;min-height:50px">
            <span class="demonstration" style="float:left;padding-top:10px;color:white;margin-left:1%">
                爱往亭 后台管理
            </span>
     <span class="demonstration" style="float:right;padding-top:10px;margin-right:1%">
                <el-dropdown trigger="click">
                  <span class="el-dropdown-link" style="color:white">
                    admin<i class="el-icon-caret-bottom el-icon--right"></i>
                  </span>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>个人信息</el-dropdown-item>
                    <el-dropdown-item>退出登录</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
            </span>
    </div>

    <div style="margin-top:5px">

      <el-row :gutter="10">
        <el-col :xs="4" :sm="4" :md="4" :lg="4">
          <div>
            <el-menu :default-active="defaultActive" class="el-menu-vertical-demo" style="min-height:900px" @select="handleSelect"  router>
              <el-menu-item index="manage"><i class="el-icon-menu"></i>首页</el-menu-item>
              	<el-submenu index="1">
					    	    <template slot="title"><i class="el-icon-document"></i>会员管理</template>
						        <el-menu-item index="explain">会员列表</el-menu-item>
                    <el-menu-item index="explain">实名认证</el-menu-item>
					    </el-submenu>
            		<el-submenu index="2">
						        <template slot="title"><i class="el-icon-plus"></i>权限管理</template>
						        <el-menu-item index="adminSet">管理员列表</el-menu-item>
                    <el-menu-item index="adminSet">角色列表</el-menu-item>
                    <el-menu-item index="adminSet">菜单列表</el-menu-item>
					    </el-submenu>
              <el-submenu index="3">
						        <template slot="title"><i class="el-icon-star-on"></i>社区管理</template>
						        <el-menu-item index="adminSet">社区注册</el-menu-item>
                    <el-menu-item index="adminSet">社区申请</el-menu-item>
                    <el-menu-item index="adminSet">咨询列表</el-menu-item>
					    </el-submenu>
              <el-submenu index="4">
						        <template slot="title"><i class="el-icon-edit"></i>数据统计</template>
						        <el-menu-item index="adminSet">关键指标</el-menu-item>
                    <el-menu-item index="adminSet">数据统计列表</el-menu-item>
					    </el-submenu>
            </el-menu>
          </div>
        </el-col>
        <el-col :xs="20" :sm="20" :md="20" :lg="20">
          <div>
            <div style="border: 1px solid #A6A6A6; border-radius:6px; padding:5px; margin:2px; background-color: white">
              <el-breadcrumb separator="/">
                <el-breadcrumb-item v-for="item in breadcrumbItems">{{item}}</el-breadcrumb-item>
              </el-breadcrumb>
            </div>
          </div>
        <div style="margin-top:10px">
            <router-view></router-view>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
  </div>
</template>

<script>
export default {
  name: 'header',
     data(){
      return {
        searchCriteria: '',
        breadcrumbItems: ['导航一'],
      }
    },
     handleSelect(key, keyPath){
        switch(key){
          case '1':
            this.$router.push('/Page1');
            this.breadcrumbItems  = ['导航一']
            break;
          case '2':
            this.$router.push('/Page2')
            this.breadcrumbItems  = ['导航二']
            break;
          case '3':
            this.$router.push('/Page3')
            this.breadcrumbItems  = ['导航三']
            break;
        }
      }
}

</script>

<style scoped lang="stylus">

</style>
